<template>
  <div>
    <el-row class="sort-bar">
      <!-- <el-col :span="12">&nbsp;

      </el-col>-->

      <el-col :span="19" style="text-align:left;">
        <el-button type="primary" size="mini" @click="onAddProduct">添加{{isMkt?'超市商品':'赠品'}}</el-button>
      </el-col>
      <el-col :span="5" class="text-right">
        <el-pagination
          class="newactli"
          layout="slot, total, prev, next, jumper"
          :current-page="page.index"
          :page-size="page.size"
          :total="page.total"
          @current-change="onCurrentChange"
        ></el-pagination>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  props:{
    isMkt:{type:Boolean,default:false},
    page:{type:Object}
  },
  data() {
    return {};
  },
  methods: {
    onAddProduct() {
      this.$emit("add-product");
    },
    onCurrentChange(currentPage) {
      this.$emit('current-change',currentPage);
    }
  }
};
</script>